<template>
  <div>
    <ul>
      <li v-for="item of msgList" :key="item.id">
        <!-- params字符串写法 -->
        <!-- <router-link :to="`/home/message/detail/${item.id}/${item.title}`">{{item.title}}</router-link>&nbsp;&nbsp; -->
        <!-- paramsd对象写法  对象形式只能用name-->
        <router-link :to='{
            name:"xiangqing",
            query:{
                id:item.id,
                title:item.title
            }
        }'>{{item.title}}</router-link>&nbsp;&nbsp;

      </li>
       
    </ul>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
    name: "Message",
    data() {
        return {
            msgList: [
                { id: "001", title: "message001" },
                { id: "002", title: "message002" },
                { id: "003", title: "message003" },
            ],
        };
    },
};
</script>

<style scoped>
</style>
